﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IlianaRuler.CPL;

namespace IlianaRuler.DAL
{
    /// <summary>
    /// 服务器
    /// </summary>
    struct ServerConfigData
    {
        /// <summary>
        /// 服务器IP
        /// </summary>
        public string ServerIp;
        /// <summary>
        /// 服务器端口
        /// </summary>
        public ushort ServerPort;

        /// <summary>
        /// 客户ID
        /// </summary>
        public string CustomerID;
        /// <summary>
        /// 密码
        /// </summary>
        public string Password;

        //public string watchword;
    }

    /// <summary>
    /// 业务处理类
    /// </summary>
    class Business
    {
        /// <summary>
        /// 获取服务器连接数据
        /// </summary>
        /// <returns></returns>
        public static ServerConfigData GetServerConfig()
        {
            //test code
            ServerConfigData d;
            d.CustomerID = "admin";
            d.Password = "root";
            d.ServerIp = "127.0.0.1";
            d.ServerPort = 1299;

            return d;
        }

        /// <summary>
        /// 向数据库增加一条新的流水历史记录
        /// </summary>
        /// <param name="id">流水ID</param>
        /// <param name="type">业务类型</param>
        /// <param name="serverIp">操作所针对的SmartServer IP，可能为空</param>
        /// <param name="nodeName">操作所针对的节点别名，可能为空</param>
        public static void RegisterHistory(Guid id, CommandType type, string serverIp, string nodeName)
        {

        }

        public static void RegisterNode(Guid id, byte nodeType, string serverIp,
            string nodeName, string neruonID, bool bindAlert, ErrorCode errorCode)
        {

        }
    }
}
